{extend name="common/adminBase" /}
{block name="body"}
<body>
<style>
    .r{
        float: right;
    }
</style>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    {if $bz}
                        <a class="layui-btn" href="{$bz}">下载评分标准</a>
                    {/if}
                </div>
                <div class="layui-card-body ">

                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>课题名称</th>
                            <th>打分</th>
                            <th>提交时间</th>
                            <th>状态</th>
                            <th>操作</th>
                            <th>查看</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="data" id="v"}
                        <tr>
                            <td>{$v.id}</td>
                            
                            <td>{$v.content.title}</td>
                            <td>
                                {if $v.dfstatus!=1}
                                <input type="number" placeholder="" id="fen_{$v.id}" value="{$v.fen}" style="text-align:center;" class="layui-input" />
                                {else/}
                                    {$v.fen}
                                {/if}
                            </td>
                            <td>{$v.time|date='Y-m-d H:i:s'}</td>
                            <td>{if $v.dfstatus==1}已提交{else/}未提交{/if}</td>
                            <td class="td-manage">
                                {if $v.dfstatus!=1}
                                    <a class="layui-btn" href="#" onclick="dafen({$v.id})">提交打分</a>
                                {/if}
                                
                                <a class="layui-btn" href="#" onclick="change({$v.id})">保存</a>
                            </td>
                            <td><a class="layui-btn" href="#" onclick="xadmin.open('查看','/index/school/chakan?id={$v.id}')">查看</a></td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        <div>
                           <?php echo $page ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

</iframe>

</body>
<script>
    layui.use('form', function(){
        var  form = layui.form;
    });
    function openmydoc(path){ 
        $('#handout_wrap_inner').media({
            width: '100%',
            height: '1000px',
            autoplay: true,
            src:"'"+path+"'",
        }); 
    } 
    function dafen(id){
        $.ajax({
                url:'/index/Classcontroller/dafenstatus',
                data:{id:id},
                type:'post',
                dataType:'json',
                success:function(res){
                    if (res.status ==1){
                            layer.msg(res.msg,{icon:1,time:1500},function () {
                                location.reload();
                            });
                        }else{
                            layer.alert(res.msg,function (index) {
                                layer.close(index);
                            })
                        }
                }
            });
    }
    function change(id){
    //   alert($(obj).val());
        var fen = $("#fen_"+id).val(); 
        // layer.confirm('确认打分吗？',function(index){
            $.ajax({
                url:'/index/Classcontroller/changefen',
                data:{id:id,fen:fen},
                type:'post',
                dataType:'json',
                success:function(res){
                    if (res.status ==1){
                            layer.msg(res.msg,{icon:1,time:1500},function () {
                                location.reload();
                            });
                        }else{
                            layer.alert(res.msg,function (index) {
                                layer.close(index);
                            })
                        }
                }
            });
            
        // });
    }
    /*用户-停用*/
    function member_del(id){
        layer.confirm('确认要删除吗？',function(index){
            $.ajax({
                url:'delAdmin',
                data:{id:id},
                type:'post',
                dataType:'json',
                success:function (res) {
                    if (res.status ==1){
                        layer.msg(res.msg,{icon:1,time:1500},function () {
                            location.reload();
                        });
                    }else{
                        layer.alert(res.msg,function (index) {
                            layer.close(index);
                        })
                    }
                }
            })

        });
    }


</script>

{/block}